package com.kyle.pagingdemo.di

import com.kyle.pagingdemo.IApi
import com.kyle.pagingdemo.paging.PostRepository
import com.kyle.pagingdemo.room.ArticleDatabase
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton


@Module
@InstallIn(SingletonComponent::class)
class RepositoryModule {

    @Provides
    @Singleton
    fun providePostRepository(api: IApi, db: ArticleDatabase): PostRepository =
        PostRepository(api, db)

}